<script lang="ts" setup>
import { ref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n'
import { ImportFail } from '@/views/wages/importfail'
import { BasicModal, useModalInner } from '@/components/Modal'

defineOptions({ name: 'ImportHistoryModal' })

const emit = defineEmits(['success', 'register'])

const { t } = useI18n()
const isUpdate = ref(true)
const historyId = ref(0)

const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
  setModalProps({ confirmLoading: false })
  historyId.value = data.record.id
})
</script>

<template>
  <BasicModal v-bind="$attrs" :title="isUpdate ? t('action.edit') : t('action.create')" :width="1200" @register="registerModal" @ok="closeModal">    <ImportFail :history-id="historyId" />
  </BasicModal>
</template>
